<template>
  <div style="height: 600px">
    <el-table
        :data="list" border style="width: 100%">
      <el-table-column prop="id" label="id" width="180">
      </el-table-column>
      <el-table-column prop="room_name" label="教室" width="180">
      </el-table-column>
      <el-table-column prop="username" label="教师">
      </el-table-column>
      <el-table-column prop="stu_count" label="学生数量">
      </el-table-column>
      <el-table-column prop="max_account" label="最大人数">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import {IP} from "@/config";
import axios from "axios";
// import moment from 'moment'

export default {
  name: "GetRoom",
  data(){
    return {
      list: []
    }
  },
  mounted() {
    let url = IP + "room/getAll"
    axios.post(url).then(res =>{
      res.data.data.roomList.forEach((item,index)=>{
        this.list.splice(index,0,item[index+1])
      })
      console.log(this.list)
    })
  }
}
</script>

<style scoped>

</style>